package cn.edu.cug.cs.gtl.renders.openinventor.callbacks;

import cn.edu.cug.cs.gtl.apis.render.callbacks.Callback;
import com.openinventor.inventor.misc.callbacks.NCallback;

public class CallbackImpl implements Callback {
    protected NCallback nativeObject =null;
    @Override
    public Object getNativeObject() {
        return nativeObject;
    }

    @Override
    public boolean attach(Object nativeObject) {
        if(nativeObject instanceof Callback){
            this.nativeObject=(NCallback) nativeObject;
            return true;
        }
        return false;
    }

    @Override
    public Object detach() {
        NCallback p = this.nativeObject;
        this.nativeObject=null;
        return p;
    }

    @Override
    public void invoke(Object userData) {

    }
}
